package sg.edu.nus.iss.billing.template;

import sg.edu.nus.iss.billing.template.interfaces.ParseAction;

/**
 * @author Daniel
 *
 */
public class BasicParseAction implements ParseAction {
	
	private String parseKey;
	private String parseValue;
	
	public BasicParseAction(String parseKey, String parseValue) {
		this.parseKey = parseKey;
		this.parseValue = parseValue;
	}
	
	public String parse(String parsedTemplate) {
		return parsedTemplate.replaceAll(parseKey, parseValue);
	}
	
	protected void setParseValue(String parseValue) {
		this.parseValue = parseValue;
	}
	
	public String getParseKey() {
		return this.parseKey;
	}

}
